package com.dxt.springmvcdemo.exception;

import lombok.Getter;

/**
 * BelongProject: springMVC
 * BelongPackage: com.dxt.springmvcdemo.exception
 * Description:
 *
 * @Author 段鑫涛
 * @Create 2025/4/14 21:17
 * @Version 1.0
 */
@Getter
public class MyBusinessException extends RuntimeException{
    private Integer code;
    private String message;

    public MyBusinessException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public MyBusinessException(MyBusinessExceptionEnum myBusinessExceptionEnum) {
        super(myBusinessExceptionEnum.getMessage());
        this.code = myBusinessExceptionEnum.getCode();
        this.message = myBusinessExceptionEnum.getMessage();
    }
}
